package com.zby.business.db;

import android.content.Context;
import android.database.DatabaseErrorHandler;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by BY on 2016/1/21.
 */
public class MyDatabaseHelper extends SQLiteOpenHelper {
    private static int VERSION = 1;

    public MyDatabaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    public MyDatabaseHelper(Context context, String name, int version) {
        this(context, name, null, version);
    }

    public MyDatabaseHelper(Context context, String name) {
        this(context, name, VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table if not exists search_record(search_record_id integer primary key autoincrement,"
                + " record varchar(50))");
        System.out.println("create db");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
